package main

import (
	"fmt"
	ling "gitee.com/tietang/terrace-go/v2/lib/tollgate"
	"gitee.com/tietang/terrace-go/v2/lib/tollgate/handler"
)

func main() {
	p := ling.NewProcessMonitor()
	p.Watch(func(nps, dps []*handler.ServiceProcess) {
		for pid, ps := range nps {
			fmt.Println("new: ", pid, ps)
		}
		for pid, ps := range dps {
			fmt.Println("deleted: ", pid, ps)
		}
	})
}
